<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@include file="../../common/includeBaseSet.jsp" %>
<%@include file="../../common/includeSystemSet.jsp" %>
<%@include file="../../common/operation_forbid.jsp" %>
<%@include file="../../common/jsVersion.jsp" %>
<div id="rightBuildingDiv">
	<form id="baseBuildingForm" method="POST" onsubmit="return false;">
	<div class="widget-main customBtn">	
	
		
	
		
		 <c:forEach var="btn" items="${permitBtn}">
        	<c:choose>
				<c:when test="${btn.permission=='estate:projectBuilding:edit'}">
					<button type="button" id="btn_buildingUpdate" class="btn btn-warning  btn-sm">
			<span class="glyphicon glyphicon-search">编辑</span>
		</button>
		&emsp;
				</c:when>
				<c:when test="${btn.permission=='estate:projectRoom:saveBatchData'}">
				<button type="button" id=btn_buildingBatchUpdate class="btn btn-primary btn-sm">
			<span class="glyphicon glyphicon-edit">批量修改</span>
		</button>
		&emsp;
				</c:when>
				<c:when test="${btn.permission=='estate:projectBuilding:delete'}">
					<button type="button" id="btn_buildingDel" class="btn btn-primary btn-sm">
			<span class="glyphicon glyphicon-minus">删除</span>
		</button>
				</c:when>
			</c:choose>							
		</c:forEach>
		
	</div>
	<c:if test="${!empty ar.obj}">
	<input type="hidden" id="projectId" value="${ar.obj.projectId}">
	<input type='hidden' name='buildingId' value="${ar.obj.id}" />
	</c:if>
	<c:if test="${!empty parentName}">
	<input type='hidden' name='parentName' value="${parentName}" />
	</c:if>
	<c:if test="${!empty manageObject}">
	<input type='hidden' name='manageObject' value="${manageObject}" />
	</c:if>
	</form>
	<c:choose>
	<c:when test="${!empty ar.obj}">
	<table id="buildingTable" class="table table-bordered table-hover" >
		<tr>
			<td style="background-color: #D8D8D8; font-size: 16px; font-weight: bold;">楼栋详情</td>
		</tr>
		<tr>
			<td><b>管理对象&emsp;&emsp;&emsp;</b>&emsp;&emsp;${manageObject}</td>
		</tr>
		<tr>
			<td><b>楼栋名称&emsp;&emsp;&emsp;</b>&emsp;&emsp;${ar.obj.buildingName}</td>
		</tr>
		<tr>
			<td><b>楼栋编号&emsp;&emsp;&emsp;</b>&emsp;&emsp;${ar.obj.buildingCode}</td>
		</tr>
		<tr>
			<td><b>交付情况&emsp;&emsp;&emsp;</b>&emsp;&emsp;
			<c:if test="${ar.obj.deliveryFlag==0}">
				未交付
			</c:if>
			<c:if test="${ar.obj.deliveryFlag==1}">
				已交付
			</c:if>
			</td>
		</tr>
		<tr>
			<td><b>交付日期&emsp;&emsp;&emsp;</b>&emsp;&emsp;<fmt:formatDate value="${ar.obj.deliveryDate}" pattern="yyyy-MM-dd"/></td>
		</tr>
		<tr>
			<td><b>装修标准&emsp;&emsp;&emsp;</b>
				&emsp;&emsp;<c:choose>
				<c:when test="${ar.obj.renovationType eq 0}">精装</c:when>
				<c:when test="${ar.obj.renovationType eq 1}">毛坯</c:when>
				<c:when test="${ar.obj.renovationType eq 2}">其他${ar.obj.renovationDesc}</c:when>
				</c:choose>
			</td>
		</tr>
		<tr>
			<td><b>开盘日期&emsp;&emsp;&emsp;</b>&emsp;&emsp;<fmt:formatDate value="${ar.obj.openTime}" pattern="yyyy-MM-dd"/></td>
		</tr>
		<tr>
			<td><b>默认定金&emsp;&emsp;&emsp;</b>&emsp;&emsp;${ar.obj.defaultEarnest}</td>
		</tr>
		<tr>
			<td><b>预售证编号&emsp;&emsp;</b>&emsp;&emsp;${ar.obj.salesPermissionNo}</td>
		</tr>
		<tr>
			<td><b>预售证领取日期</b>&emsp;&emsp;<fmt:formatDate value="${ar.obj.salesPermissionDate}" pattern="yyyy-MM-dd"/></td>
		</tr>
		<tr>
			<td><b>备&emsp;&emsp;注&emsp;&emsp;&emsp;</b>&emsp;&emsp;${ar.obj.remark}</td>
		</tr>
	</table>
	</c:when>
	<c:otherwise>
	<table id="buildingTable" class="table table-bordered table-hover" >
		<tr>
			<td style="background-color: #D8D8D8; font-size: 16px; font-weight: bold;">楼栋详情</td>
		</tr>
		<tr>
			<td style="text-align: center;"><h1>${ar.resMsg}</h1></td>
		</tr>
	</table>
	</c:otherwise>
	</c:choose>
</div>
<script src="${jypath}/static/js/estate/building/building.js?v=${jsVersion}"></script>
